home *** CD-ROM | disk | FTP | other *** search
/ Flybox Trout (Edition 1) / Flybox Trout (Edition 1).iso / Setup / Support / FlyBox.exe / FlyBox.dxr / 00006_Set Majors.ls < prev    next >
Encoding:
Text File  |  2002-04-15  |  1.9 KB  |  46 lines

  1. global DBPath
  2.  
  3. on exitFrame me
  4.   db = DGOpenDatabase(DBPath & "FlyBox.mdb", 0, 0, ";PWD=StopLooking")
  5.   rs = DGCreateRecordset("SELECT Major.* FROM Major ORDER BY Major", db)
  6.   a = 0
  7.   repeat while not DGRSisEOF(rs)
  8.     setVariable(sprite(1), "Main" & a & "_Main", DGRSGetFieldValue("Major", rs))
  9.     DGRSmoveNext(rs)
  10.     a = a + 1
  11.   end repeat
  12.   DGRSClose(rs)
  13.   rs = DGCreateRecordset("SELECT Minor.* FROM Minor LEFT JOIN Major ON Minor.MajorID = Major.MajorID ORDER BY Major, MinorType", db)
  14.   a = 0
  15.   b = 0
  16.   MajorID = 0
  17.   repeat while not DGRSisEOF(rs)
  18.     if (DGRSGetFieldValue("MajorID", rs) <> MajorID) and (MajorID <> 0) then
  19.       a = a + 1
  20.       b = 0
  21.     end if
  22.     MajorID = DGRSGetFieldValue("MajorID", rs)
  23.     setVariable(sprite(1), "Minor_" & a & "_" & b, DGRSGetFieldValue("MinorType", rs))
  24.     setVariable(sprite(1), "MinorID_" & a & "_" & b, DGRSGetFieldValue("MinorID", rs) & EMPTY)
  25.     DGRSmoveNext(rs)
  26.     b = b + 1
  27.   end repeat
  28.   DGRSClose(rs)
  29.   rs = DGCreateRecordset("SELECT TOP 1 Registration.* FROM Registration", db)
  30.   setVariable(sprite(1), "FirstName", DGRSGetFieldValue("FirstName", rs))
  31.   setVariable(sprite(1), "Surname", DGRSGetFieldValue("Surname", rs))
  32.   setVariable(sprite(1), "Address", DGRSGetFieldValue("Address", rs))
  33.   setVariable(sprite(1), "EMail", DGRSGetFieldValue("EMail", rs))
  34.   setVariable(sprite(1), "Password", DGRSGetFieldValue("Password", rs))
  35.   setVariable(sprite(1), "AffiliationID", DGRSGetFieldValue("AffiliationID", rs))
  36.   setVariable(sprite(1), "AffiliationPassword", DGRSGetFieldValue("AffiliationPassword", rs))
  37.   setVariable(sprite(1), "ReceiveInfo", DGRSGetFieldValue("ReceiveInfo", rs) & EMPTY)
  38.   setVariable(sprite(1), "Trusted", DGRSGetFieldValue("Trusted", rs) & EMPTY)
  39.   setVariable(sprite(1), "Cookie", DGRSGetFieldValue("StoreCookie", rs) & EMPTY)
  40.   DGRSClose(rs)
  41.   DGClose(db)
  42.   DGSetRegVal("HKEY_LOCAL_MACHINE", "SOFTWARE\FlyBox", "AppPath", the applicationPath)
  43.   sprite(1).goToFrame("Categories")
  44.   go("Finished")
  45. end
  46.